package com.Yukiha.gachamod.gachaMenu;

import com.Yukiha.gachamod.GachaMod;
import com.Yukiha.gachamod.gachaMenu.client.gui.GachaBookMenu;
import net.minecraft.world.inventory.MenuType;
import net.minecraftforge.common.extensions.IForgeMenuType;
import net.minecraftforge.network.IContainerFactory;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

@SuppressWarnings("removal")
public class ModMenuTypes {

    public static final String MODID = GachaMod.MODID; // 或使用 GachaMod.MODID

    public static final DeferredRegister<MenuType<?>> MENUS =
            DeferredRegister.create(ForgeRegistries.MENU_TYPES, MODID);

    public static final RegistryObject<MenuType<GachaBookMenu>> GACHA_BOOK_MENU =
            MENUS.register("gacha_book_menu",
                    () -> IForgeMenuType.create((containerId, inventory, buffer) ->
                            new GachaBookMenu(ModMenuTypes.GACHA_BOOK_MENU.get(), containerId, inventory, buffer)
                    )
            );

    public static void register() {
        MENUS.register(FMLJavaModLoadingContext.get().getModEventBus());
    }
}
